package com.cjst.controller.location;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cjst.pojo.location.ManagedLocation;
import com.cjst.service.location.ManagedLocationService;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

@Controller
@RequestMapping("/location/managedLocation")
public class ManagedLocationController {
	
	private static final Logger log = Logger.getLogger(ManagedLocationController.class);
	@Autowired
	private ManagedLocationService managedLocationService;
	
	@RequestMapping(value = "/test", method = RequestMethod.GET)
	@ResponseBody
    public String toParts() {
		List<ManagedLocation> tmp=managedLocationService.list(null);
		JSONArray result=JSONArray.fromObject(tmp);
		System.out.println(tmp.toString());
		System.out.println(result.toString());
		return result.toString();
    }

}
